<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
	    <div class="btn-toolbar">
	    	<a class="btn btn-danger refresh" href="/config/crefresh?doClear=1" tips="全站缓存" style="position:relative;float:right;padding:3px 6px;margin-right:7px;margin-top:-62px">更新全站缓存</a>
	    	<button class="btn btn-primary ifrm" data-url="/config/addset" data-width="650" data-height="650" data-title="添加变量" data-params="" style="position:relative;float:right;padding:3px 6px;margin-right:10px">添加变量</button>
		    <form>
		    	<label style="display: inline;">变量名称：</label>
		    	<input type="text" value="<?=I('get.name')?>" name="name" />
		    	<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
		</div>
		<hr>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center">序号</th>
		          <th style="text-align:center">变量标题</th>
		          <th style="text-align:center">变量名称</th>
		          <th style="text-align:center">变量值</th>
		          <th style="text-align:center">添加时间</th>
		          <th style="text-align:center">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php if($getData){foreach($getData AS $key=>$val){ ?>
		        <tr> 
		          <td style="text-align:center;"><?=$val['id']?></td>
		          <td style="text-align:center;"><?=$val['config_desc']?>&nbsp;<?=$val['is_system'] ? '<span class="label label-success" style="font-size:8px">系统变量</span>' : ''?></td>
		          <td style="text-align:center;"><?=$val['config_column']?></td>
		          <td style="text-align:center;" title="<?=$val['config_val']?>"><?=mb_substr($val['config_val'],0,40)?></td>
		          <td style="text-align:center;"><?=date('Y-m-d',$val['add_at'])?></td>
		          <td style="text-align:center">
		          	  <a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/config/addset" data-width="650" data-height="450" style="padding: 0px 4px;" data-title="修改变量" data-params="id/<?=$val['id']?>"><i class="icon-pencil"></i></a>&nbsp;&nbsp;&nbsp;
		              <?php if(!$val['is_system']){?>
		              <a href="/config/delete?id=<?=$val['id']?>" class="delete btn btn-danger" style="padding: 0px 4px;" data-toggle="modal"><i class="icon-remove"></i></a>
		              <?php }?>
		          </td>
		        </tr>
		        <?php }}?>
		      </tbody>
		   </table>
		   <span style="float:right;margin-top:-44px"><?=$page?></span>
	</div>
</div>
<script>
$(function(){
	$('.delete').click(function(){
		if(!(window.confirm('确认要删除该变量吗 ?'))){
			return false;
		}		
		window.location = $(this).attr('href');
	});
})
</script>